import { CacheUtils } from "@/utils/cache"

const LOCAL_CACHE_KEY = 'sd-config'
export class OptionsApi {
    static async getConfig(): Promise<OptionsInfo | undefined> {
        const temp = await CacheUtils.get(LOCAL_CACHE_KEY)
        if (!temp) {
            return undefined
        }
        return temp
    }

    static async save(data: OptionsInfo) {
        await CacheUtils.set(LOCAL_CACHE_KEY, data, -1)
    }
}